<template>
	<view class="home-like">
		<view class="title">
			猜你喜欢
		</view>

		<view class="list">
			<view class="item" v-for="item in dataList" :key="item.id"  @tap="toGoodsInfo(item.id)">
				<image :src="item.pic" mode=""></image>
				<view class="text-holder">
					<view class="text">
						{{item.brandName}}
					</view>
					<view class="price">
						<text>￥{{item.price}}</text>
						<text>乐居</text>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props:["dataList"],
		methods: {
			toGoodsInfo(id){
				uni.navigateTo({
					url: `/pages/goodsInfo/goodsInfo?goodsId=${id}`,
				})
			}
		},
	}
</script>

<style lang="scss" scoped>
	.home-like {
		box-sizing: border-box;
		padding: 0 30rpx;
		width: 100%;

		.title {
			padding: 30rpx 0;
			font-size: 32rpx;
			color: 3e3e3e;
			font-weight: 600;
		}

		.list {
			display: flex;
			justify-content: space-between;
			flex-wrap: wrap;
			width: 100%;

			.item {
				margin: 20rpx 0;
				width: 324rpx;
				height: 416rpx;
				background-color: #fff;
				image{
					width: 100%;
					height: 238rpx;
				}
				.text-holder{
					display: flex;
					flex-wrap: wrap;
					box-sizing: border-box;
					padding: 30rpx;
					width: 100%;
					height: 170rpx;
					
					.text{
						width: 100%;
						font-weight: 700;
						font-size: 26rpx;
					}
					.price{
						width: 100%;
						display: flex;
						justify-content: space-between;
						font-size: 24rpx;
					}
				}
			}
		}
	}
</style>
